package org.example.springbootproject.controller;

import org.example.springbootproject.pojo.Result;
import org.example.springbootproject.pojo.Warehousing;
import org.example.springbootproject.service.WarehousingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/warehousing")
public class WarehousingController {
    @Autowired
    private WarehousingService warehousingService;

    @GetMapping("/getWarehousing")
    public Result<List<Warehousing>> getWarehousing() {
        List<Warehousing> list = warehousingService.findWarehousing();
        return Result.success(list);
    }

    @PostMapping("/upDateWarehousing")
    public Result upDateWarehousing(@RequestBody Warehousing warehousing) {
        warehousingService.upDateWarehousing(warehousing);
        return Result.success();
    }
}
